package com.techchat.backend.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import jakarta.annotation.Nonnull; // 使用 Jakarta 注解
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Message {

    public enum MessageType {
        USER,
        SYSTEM_NICKNAME_CHANGE,
        IMAGE // <-- 新增图片消息类型
    }

    private Long id;

    @Nonnull
    private String content; // 对于图片消息, 此字段将存储图片的URL

    @Nonnull
    private String sender; // For system messages, this could be "系统提示" or similar

    @Nonnull
    private LocalDateTime timestamp;

    @Builder.Default
    private MessageType messageType = MessageType.USER; // Default to USER
}
